package com.arpa.oms.domain.entity;

import java.math.BigDecimal;
import java.time.LocalDateTime;
import java.util.List;

import com.alibaba.fastjson.annotation.JSONField;
import com.arpa.wms.domain.entity.BasicEntity;
import com.baomidou.mybatisplus.annotation.TableField;
import io.swagger.annotations.ApiModel;
import io.swagger.annotations.ApiModelProperty;
import lombok.Data;
import lombok.EqualsAndHashCode;
import org.springframework.format.annotation.DateTimeFormat;

import javax.validation.constraints.NotEmpty;

/**
 * <p>
 * 拆单规则
 * </p>
 *
 * @author spb
 * @since 2021-07-23
 */
@Data
@EqualsAndHashCode(callSuper = true)
@ApiModel(value="OmsUnpackRule对象", description="拆单规则")
public class OmsUnpackRule extends BasicEntity {

    private static final long serialVersionUID = 1L;

    @ApiModelProperty(value = "规则编码code")
    private String code;

    @ApiModelProperty(value = "规则名称")
    @NotEmpty(message = "规则名称不能为空！", groups = {Update.class, Save.class})
    private String ruleName;

    @ApiModelProperty(value = "入驻商")
    @NotEmpty(message = "货主不能为空！", groups = {Update.class, Save.class})
    private String shipmentCode;

    @ApiModelProperty(value = "货主名称")
    private String shipmentName;

    @ApiModelProperty(value = "店铺编码code")
    @NotEmpty(message = "店铺不能为空！", groups = {Update.class, Save.class})
    private String shopCode;

    @ApiModelProperty(value = "店铺名称")
    private String shopName;

    @ApiModelProperty(value = "规则类型：0：按体积，1：按重量，2：按商品，3：按数量")
    @NotEmpty(message = "拆单规则类型不能为空！", groups = {Update.class, Save.class})
    private String ruleType;

    @ApiModelProperty(value = "备注")
    private String remark;

    @ApiModelProperty(value = "状态，0-启用，1-停用")
    private String status;

    @ApiModelProperty(value = "值（千克、立方米）")
    private BigDecimal ruleValue;

    @ApiModelProperty(value = "是否所有商品，默认：1， 0-否，1-是")
    private String allGoods;

    @ApiModelProperty(value = "是否拆组合,默认：0，1-是，2-否")
    private String unpackCompose;

    @ApiModelProperty(value = "开始时间")
    @DateTimeFormat(pattern = "yyyy-MM-dd HH:mm:ss")
    @JSONField(format = "yyyy-MM-dd HH:mm:ss")
    private LocalDateTime runningStart;

    @ApiModelProperty(value = "结束时间")
    @DateTimeFormat(pattern = "yyyy-MM-dd HH:mm:ss")
    @JSONField(format = "yyyy-MM-dd HH:mm:ss")
    private LocalDateTime runningEnd;

    @ApiModelProperty(value = "明细")
    @TableField(exist = false)
    private List<String> unpackGoods;

    @ApiModelProperty(value = "商品名称")
    @TableField(exist = false)
    private List<String> goodNameList;

    public interface Save {

    }

    public interface Update {

    }
}
